package tech.waterism.topo.engine;

import tech.waterism.topo.context.CalculationContext;
import tech.waterism.topo.model.TopoNode;

/**
 * 节点统计器接口
 * 
 * <p>定义节点统计的标准接口，由 service 层实现具体的统计逻辑
 * 
 * <h3>实现示例：</h3>
 * <pre>
 * public class ServiceLayerStatistician implements NodeStatistician {
 *     &#64;Autowired
 *     private StatisticsCalculate statisticsCalculate;
 *     
 *     &#64;Override
 *     public void calculate(TopoNode node, CalculationContext context) {
 *         DispatchStatisticsDto statistics = statisticsCalculate.calculate(...);
 *         // 将结果设置到 node 中
 *     }
 * }
 * </pre>
 * 
 * @author waterism
 * @since 1.0.0
 */
@FunctionalInterface
public interface NodeStatistician {
    
    /**
     * 执行节点统计
     * 
     * @param node 拓扑节点
     * @param context 计算上下文
     */
    void calculate(TopoNode node, CalculationContext context);
}

